package cn.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.dao.LogMapper;
import cn.domain.Log;
import cn.entity.LogJsp;
import cn.service.LogService;
import cn.util.Pagination;

@Service
@Transactional(rollbackFor=Exception.class)
public class LogServiceImpl implements LogService {

	@Autowired
	private LogMapper logMapper;

	@Override
	public void insert(Log  log) {
		logMapper.insert(log);
	}


	@Override
	public int getAllCount(Log  log) {
		return logMapper.getAllCount(log);
	}


	@Override
	public List<Log> getAlllist(Pagination pagination) {
		pagination.setStartRow((pagination.getPageIndex() - 1) * pagination.getPageSize());
		List<Log> list = logMapper.getAlllist(pagination);
		return list;
	}


	@Override
	public void delete(String deleteId) {
	}

	@Override
	public boolean getOne(Log log) {
		return false;
	}


	@Override
	public Log selectOne(String deleteId) {
		return logMapper.selectByPrimaryKey(Integer.parseInt(deleteId));
	}


	@Override
	public void update(Log log) {
		logMapper.updateByPrimaryKey(log);
	}


	@Override
	public List<LogJsp> getAllByApiid(Integer id) {
		return logMapper.getAllByApiid(id);
	}

}
